package com.tanhua.test;

import com.easemob.im.server.EMProperties;
import com.easemob.im.server.EMService;
import com.easemob.im.server.model.EMTextMessage;

import java.util.HashSet;
import java.util.Set;

public class HuanxinTest01 {

    public static void main(String[] args) {
        EMProperties properties = EMProperties.builder()
                .setAppkey("1138220317114990#demo")
                .setClientId("YXA6jDkGqkHzTnu7GXF-vnJixg")
                .setClientSecret("YXA6nV2MKXoCxonBNV-yM9d9NwOwRg0")
                .build();

        EMService service = new EMService(properties);

        //创建环信用户
        //service.user().create("user02", "123456").block();

        //创建好友关系
        //service.contact().add("user01","user02").block();

        //删除好友关系
        //service.contact().remove("user01","user02").block();

        //发送消息
        Set<String> set = new HashSet<>();
        set.add("user02");
        service.message().send("user01","users",set,new  EMTextMessage().text("java牛逼"),null);

        System.out.println("ok");
    }



}
